import { createSlice } from '@reduxjs/toolkit'

export const tokenslice = createSlice({
  name: 'counter',
  initialState: {
    token:''
  },
  reducers: {
   addtoken(state,{payload}){
    console.log('payload',payload)
        state.token=payload
   }
  }
})
// 每个 case reducer 函数会生成对应的 Action creators
export const {  addtoken} = tokenslice.actions

export default tokenslice.reducer